package com.woniuxy.main;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

@SpringBootApplication
@MapperScan("com.woniuxy.main.mapper")
@EnableWebSocket
public class WoniuYogaApplication {

	public static void main(String[] args) {
		SpringApplication.run(WoniuYogaApplication.class, args);
	}

	/**
	 * 配置websocket依赖的对象
	 * 
	 * <bean class="...ServerEndpointExporter">
	 *	
	 *	在容器中创建bean对象，在websocket中需要使用到该对象 
	 *
	 * @return
	 */
	@Bean
	public ServerEndpointExporter endpointExporter(){
		return new ServerEndpointExporter();
	}
}
